package com.example.demo.domain.entity;

import com.example.demo.domain.enums.OrderStatus;
import lombok.Data;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;

@Entity
@Table(name = "tb_order")
@Data
@EntityListeners(AuditingEntityListener.class)
public class OrderEntity {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    private String orderCode;
    @Enumerated(EnumType.STRING)
    private OrderStatus status;
    private String name;
    private BigDecimal price;
    private int deleteFlag;
    @CreatedDate
    private Date createTime;
    @LastModifiedDate
    private Date updateTime;
    private String createUserCode;
    private String updateUserCode;
    private int version;
    private String remark;
}
